package com.clkj.xiuzheng.dao;

import com.clkj.xiuzheng.pojo.Factory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface FactoryMapper extends Mapper<Factory> {
    @Update("update t_cl_factory set factory_status = 0 where factory_id = #{factoryId}")
    void updateFactoryDownById(@Param("factoryId") Integer factoryId);
    @Update("update t_cl_factory set factory_status = 1 where factory_id = #{factoryId}")
    void updateFactoryUpById(Integer factoryId);
    @Select("select * from t_cl_factory where factory_name like '%${factoryName}%' ")
    List<Factory> getFactoryByName(@Param("factoryName") String factoryName);
}
